#ifndef ITERATORLINK_H
#define ITERATORLINK_H

#include "contest_interface.h"

class IteratorLink {
private:
    Record *current;
    IteratorLink *_next;
    IteratorLink *_previous;

public:
    IteratorLink();
    IteratorLink(Record * _current);
    ~IteratorLink();

    void release(bool deleteRecord);

    // Return the record to which the iterator refers
    Record* value();

    IteratorLink* insert(Record * new_record) throw (ErrorCode);
    IteratorLink* next();
    IteratorLink* previous();

    void setValue(Record *r, bool deleteRecords);
    void setValue(Record *r);

    bool hasNext();
    bool isFirst();
};

#endif /*ITERATORLINK_H*/
